package leetCode;

public class t383 {
    public static void main(String[] args) {

    }
}
class Solution383 {
    public boolean canConstruct(String ransomNote, String magazine) {
        int nums[]=new int[26];
        for (char a:magazine.toCharArray()){
            nums[a-'a']++;
        }
        for (char a:ransomNote.toCharArray()){
            nums[a-'a']--;
        }
        for (int i=0;i<nums.length;i++){
            if (nums[i]<0){
                return false;
            }
        }
        return true;
    }
}